function Lbt(el) {
    this.el = document.querySelector(el)
    this.ullis = this.el.querySelectorAll('ul li')
    this.img = this.el.querySelector('img')
    this.num = 1
    this.t = null
    this.init()
}
Lbt.prototype.init = function () {
    //切换图片
    this.changeImg()
    //鼠标移入移出
    this.OverOut()
}
Lbt.prototype.changeImg = function () {
    this.t = setInterval(() => {
        this.num++
        if (this.num > 6) this.num = 1
        this.img.src = `./imgs/${this.num}.jpg`
        this.changePages()
    }, 1000)
}
Lbt.prototype.OverOut = function () {
    this.ullis.forEach((item, i) => {
        item.onmouseover = () => {
            clearInterval(this.t)
            this.num = i + 1
            this.img.src = `./imgs/${this.num}.jpg`
            this.changePages()
            item.onmouseout = () => {
                this.changeImg()
            }
        }
    })
}
Lbt.prototype.changePages = function () {
    this.el.querySelector('ul li.active').className = ''
    this.ullis[this.num - 1].className = 'active'
}